﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace PSE.Updater.Common.Configurations.Server
{
    /// <summary>
    /// Representa uma coleção de observadores
    /// </summary>
    public class WatcherConfigurationElementCollection : ConfigurationElementCollection
    {
        protected override ConfigurationElement CreateNewElement()
        {
            return new WatcherConfigurationElement();
        }

        protected override object GetElementKey(ConfigurationElement element)
        {
            return ((WatcherConfigurationElement)element).Directory;
        }

        /// <summary>
        /// Obtém o nome de um elemento
        /// </summary>
        protected override string ElementName
        {
            get { return "watcher"; }
        }

        /// <summary>
        /// Obtém o tipo da Coleção
        /// </summary>
        public override ConfigurationElementCollectionType CollectionType
        {
            get { return ConfigurationElementCollectionType.BasicMap; }
        }
    }
}
